<template>
  <div>
    <div v-for="(item,index) in test"
         :key="index">
      <div class="match_news clear fl">
        <div class="match_news_pic fl">
          <a href="javascript:void(0)">
            <img :src="item.img"
                 alt />
          </a>
        </div>

        <div class="line-ss fl">
          <a href="javascript:void(0)"
             class="news-txt fl">{{item.name}}</a>
          <a href="javascript:void(0)"
             class="news-txt1 fl">{{item.name1}}</a>
        </div>
        <div>
          <ul class="news-list clear fl">
            <li v-for="(item1,index) in item.txt"
                :key="index">
              <span class="news-type fl">{{item.news}}</span>
              <a href="javascript:void(0)"
                 class="news-txt fl">{{item1.text}}</a>
              <em class="news-time fr">{{item1.time}}</em>
            </li>
          </ul>
        </div>
      </div>
      <ul class="video_list fl">
        <li class="tganime"
            v-for="(item2,index) in item.video"
            :key="index">
          <a href="javascript:void(0)"
             @mouseenter="conImgEnter"
             @mouseleave="conImgLeave">
            <img :src="item2.video_img"
                 alt />
            <span class="play-bar clear">
              <em class="ico-play fl">{{item2.video_pop}}</em>
              <em class="fr">{{item2.video_time}}</em>
            </span>
            <span class="video-tit">{{item2.video_name}}</span>
            <div class="mask">
              <span class="mask-ico"></span>
            </div>
          </a>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
export default {
  data: () => ({
    test: []
  }),
  created () {
    this.getTest()
  },
  methods: {
    async getTest () {
      const { data, status } = await this.$axios('/gettest')
      if (status !== 200) alert('数据请求不到')
      this.test = data[2]
    },
    conImgEnter (e) {
      e.currentTarget.lastElementChild.style.display = 'block'
    },
    conImgLeave (e) {
      e.currentTarget.lastElementChild.style.display = 'none'
    }
  }
}
</script>
<style lang="less" scoped>
.match_news_pic {
  display: inline-block;
  margin-bottom: 15px;
  a {
    width: 211px;
    height: 260px;
    display: block;
    float: left;
    margin-right: 19px;
    img {
      width: 211px;
      height: 260px;
      display: block;
      border: 0;
      border-radius: 2px 2px 2px 2px;
    }
  }
}
.line-ss {
  display: inline-block;
  background: none;
  width: 577px;
  margin: 0;
  padding: 0;
  height: 66px;
  line-height: 32px;

  a {
    color: #333333;
    width: 629px;
    overflow: hidden;
    text-align: center;
    font-size: 28px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .news-txt1 {
    line-height: 23px;
    font-size: 14px;
    color: #666666;
    width: 450px;
    font-weight: normal;
    text-align: left;
  }
  .news-txt:hover {
    text-decoration: underline;
  }
}
.news-list {
  float: left;
  width: 577px;
  li {
    margin-bottom: 9px;
    overflow: hidden;
    .news-type {
      font-size: 12px;
      display: block;
      width: 48px;
      height: 19px;
      line-height: 19px;
      margin-right: 12px;
      background: #e3e3e3;
      border-radius: 10px;
      border: 2px solid #e3e3e3;
      text-align: center;
      color: #999999;
      text-indent: 2px;
    }
    .news-txt {
      color: #333;
      width: 470px;
      font-size: 14px;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }
    .news-txt:hover {
      text-decoration: underline;
    }
    .news-time {
      font-size: 12px;
      color: #b8b9c5;
      font-style: normal;
    }
  }
}
.video_list {
  li {
    float: left;
    width: 206px;
    margin: 0 12px 30px 0;
    position: relative;
    a {
      position: relative;
      display: block;
      width: 212px;
      .mask {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 209px;
        height: 125px;
        background-color: #333;
        opacity: 0.5;
        .mask-ico {
          width: 40px;
          height: 40px;
          display: inline-block;
          position: absolute;
          left: 50%;
          top: 50%;
          margin-left: -20px;
          margin-top: -20px;
          background-repeat: no-repeat;
          background-image: url('http://game.gtimg.cn/images/yxzj/match/center2018/images/bigwatch.png');
        }
      }
      .video-tit {
        display: block;
        height: 40px;
        overflow: hidden;
        color: #333333;
        margin-top: 10px;
        font: 14px/1.5 'Microsoft YaHei', Tahoma, 'simsun', sans-serif;
      }
      .play-bar {
        position: absolute;
        top: 104px;
        left: 0;
        width: 189px;
        height: 22px;
        line-height: 22px;
        padding: 0 10px;
        color: #fff;
        background: rgba(0, 0, 0, 0.6);
        font-size: 12px;
        border-radius: 0 0 2px 2px;
        .ico-play {
          background: url(//game.gtimg.cn/images/yxzj/web201706/images/comm/index.png) no-repeat;
          display: inline-block;
          padding-left: 15px;
          background-position: -256px -59px;
        }
        em {
          font-style: normal;
        }
      }
      img {
        width: 209px;
        height: 125px;
        display: block;
        border: 0;
        border-radius: 2px 2px 2px 2px;
      }
    }
  }
}
.clear:after {
  clear: both;
  content: ' ';
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
.fl {
  float: left;
}
.fr {
  float: right;
}
ul,
p,
div,
li,
h1,
h2,
h3,
h4,
h5,
h6 span {
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
}
li {
  list-style: none;
}
div {
  display: block;
}
</style>
